package crmdna.client.participant;

import java.util.Set;

import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;

import crmdna.client.contactdetail.ContactDetail.Gender;
import crmdna.client.participant.Participant.ParticipantProp;

@Entity @Cache
public class ParticipantEntity {	
	@Id long participantId;
	
	@Index String email;
	
	String firstName;
	String lastName;
	
	Gender gender;
	
	String homePhone;
	String officePhone;
	@Index String mobilePhone;
	
	String homeAddress;
	String officeAddress;
		
	@Index long programId;
	long groupId;
	
	@Index long memberId;
	
	@Index Set<String> qsTags;
	
	public ParticipantProp toProp() {
		ParticipantProp prop = new ParticipantProp();
		prop.participantId = participantId;
		
		prop.contactDetail.email = email;
		prop.contactDetail.firstName = firstName;
		prop.contactDetail.lastName = lastName;
		prop.contactDetail.gender = gender;
		prop.contactDetail.homePhone = homePhone;
		prop.contactDetail.officePhone = officePhone;
		prop.contactDetail.mobilePhone = mobilePhone;
		prop.contactDetail.homeAddress = homeAddress;
		prop.contactDetail.officeAddress = officeAddress;
		
		prop.programId = programId;
		prop.memberId = memberId;
		prop.programId = programId;
		
		return prop;
	}
}
